import 'package:factoryside/bean/order_list_entity.dart';

orderListEntityFromJson(OrderListEntity data, Map<String, dynamic> json) {
	if (json['OrderID'] != null) {
		data.orderID = json['OrderID'] is String
				? int.tryParse(json['OrderID'])
				: json['OrderID'].toInt();
	}
	if (json['StateHtml'] != null) {
		data.stateHtml = json['StateHtml'].toString();
	}
	if (json['State'] != null) {
		data.state = json['State'].toString();
	}
	if (json['Phone'] != null) {
		data.phone = json['Phone'].toString();
	}
	if (json['UserName'] != null) {
		data.userName = json['UserName'].toString();
	}
	if (json['Address'] != null) {
		data.address = json['Address'].toString();
	}
	if (json['Guarantee'] != null) {
		data.guarantee = json['Guarantee'].toString();
	}
	if (json['CreateDate'] != null) {
		data.createDate = json['CreateDate'].toString();
	}
	if (json['TypeName'] != null) {
		data.typeName = json['TypeName'].toString();
	}
	if (json['UpdateTime'] != null) {
		data.updateTime = json['UpdateTime'];
	}
	if (json['CompanyName'] != null) {
		data.companyName = json['CompanyName'].toString();
	}
	if (json['OrderMoney'] != null) {
		data.orderMoney = json['OrderMoney'] is String
				? double.tryParse(json['OrderMoney'])
				: json['OrderMoney'].toDouble();
	}
	if (json['BeyondMoney'] != null) {
		data.beyondMoney = json['BeyondMoney'] is String
				? double.tryParse(json['BeyondMoney'])
				: json['BeyondMoney'].toDouble();
	}
	if (json['LastReturnVisitDate'] != null) {
		data.lastReturnVisitDate = json['LastReturnVisitDate'];
	}
	if (json['OrderRecord'] != null) {
		data.orderRecord = json['OrderRecord'].toString();
	}
	if (json['UserID'] != null) {
		data.userID = json['UserID'].toString();
	}
	if (json['Product'] != null) {
		data.product = json['Product'].toString();
	}
	if (json['OutputOrderAllRecordInfoDtos'] != null) {
		data.outputOrderAllRecordInfoDtos = new List<OrderListOutputOrderAllRecordInfoDto>();
		(json['OutputOrderAllRecordInfoDtos'] as List).forEach((v) {
			data.outputOrderAllRecordInfoDtos.add(new OrderListOutputOrderAllRecordInfoDto().fromJson(v));
		});
	}
	if (json['Prodcts'] != null) {
		data.prodcts = new List<OrderListProdct>();
		(json['Prodcts'] as List).forEach((v) {
			data.prodcts.add(new OrderListProdct().fromJson(v));
		});
	}
	if (json['SignList'] != null) {
		data.signList = new List<dynamic>();
		data.signList.addAll(json['SignList']);
	}
	if (json['OrderNumber'] != null) {
		data.orderNumber = json['OrderNumber'].toString();
	}
	if (json['Memo'] != null) {
		data.memo = json['Memo'].toString();
	}
	if (json['ThirdPartyOrderNumber'] != null) {
		data.thirdPartyOrderNumber = json['ThirdPartyOrderNumber'].toString();
	}
	return data;
}

Map<String, dynamic> orderListEntityToJson(OrderListEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['OrderID'] = entity.orderID;
	data['StateHtml'] = entity.stateHtml;
	data['State'] = entity.state;
	data['Phone'] = entity.phone;
	data['UserName'] = entity.userName;
	data['Address'] = entity.address;
	data['Guarantee'] = entity.guarantee;
	data['CreateDate'] = entity.createDate;
	data['TypeName'] = entity.typeName;
	data['UpdateTime'] = entity.updateTime;
	data['CompanyName'] = entity.companyName;
	data['OrderMoney'] = entity.orderMoney;
	data['BeyondMoney'] = entity.beyondMoney;
	data['LastReturnVisitDate'] = entity.lastReturnVisitDate;
	data['OrderRecord'] = entity.orderRecord;
	data['UserID'] = entity.userID;
	data['Product'] = entity.product;
	if (entity.outputOrderAllRecordInfoDtos != null) {
		data['OutputOrderAllRecordInfoDtos'] =  entity.outputOrderAllRecordInfoDtos.map((v) => v.toJson()).toList();
	}
	if (entity.prodcts != null) {
		data['Prodcts'] =  entity.prodcts.map((v) => v.toJson()).toList();
	}
	if (entity.signList != null) {
		data['SignList'] =  [];
	}
	data['OrderNumber'] = entity.orderNumber;
	data['Memo'] = entity.memo;
	data['ThirdPartyOrderNumber'] = entity.thirdPartyOrderNumber;
	return data;
}

orderListOutputOrderAllRecordInfoDtoFromJson(OrderListOutputOrderAllRecordInfoDto data, Map<String, dynamic> json) {
	if (json['RecordId'] != null) {
		data.recordId = json['RecordId'] is String
				? int.tryParse(json['RecordId'])
				: json['RecordId'].toInt();
	}
	if (json['CreateDate'] != null) {
		data.createDate = json['CreateDate'].toString();
	}
	if (json['Content'] != null) {
		data.content = json['Content'].toString();
	}
	return data;
}

Map<String, dynamic> orderListOutputOrderAllRecordInfoDtoToJson(OrderListOutputOrderAllRecordInfoDto entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['RecordId'] = entity.recordId;
	data['CreateDate'] = entity.createDate;
	data['Content'] = entity.content;
	return data;
}

orderListProdctFromJson(OrderListProdct data, Map<String, dynamic> json) {
	if (json['ProductType'] != null) {
		data.productType = json['ProductType'].toString();
	}
	if (json['BrandName'] != null) {
		data.brandName = json['BrandName'].toString();
	}
	if (json['SubCategoryName'] != null) {
		data.subCategoryName = json['SubCategoryName'].toString();
	}
	if (json['Memo'] != null) {
		data.memo = json['Memo'].toString();
	}
	if (json['ProdModelName'] != null) {
		data.prodModelName = json['ProdModelName'].toString();
	}
	if (json['Num'] != null) {
		data.num = json['Num'].toString();
	}
	if (json['OrderID'] != null) {
		data.orderID = json['OrderID'] is String
				? int.tryParse(json['OrderID'])
				: json['OrderID'].toInt();
	}
	return data;
}

Map<String, dynamic> orderListProdctToJson(OrderListProdct entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['ProductType'] = entity.productType;
	data['BrandName'] = entity.brandName;
	data['SubCategoryName'] = entity.subCategoryName;
	data['Memo'] = entity.memo;
	data['ProdModelName'] = entity.prodModelName;
	data['Num'] = entity.num;
	data['OrderID'] = entity.orderID;
	return data;
}